package com.yanqu.road.server.cmd.activity.sonhai;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SonHaiProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.sonhai.CrossSonHaiActivity;
import com.yanqu.road.server.manager.activity.sonhai.CrossSonHaiActivityMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C2_SON_HAI_SERVER_SEND_VIP_AVE_TO_CROSS, desc = "山海伏兽-区服上报vip")
public class CrossSonHaiSendVipAveToCrossCmd extends CrossUnionCommand {


    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SonHaiProto.SonHaiCrossNotifyVipPowerReqMsg reqMsg = SonHaiProto.SonHaiCrossNotifyVipPowerReqMsg.parseFrom(packet.getBytes());
        CrossSonHaiActivity activity = CrossSonHaiActivityMgr.getActivity(reqMsg.getActivityId(), groupId);
        if (activity == null) {
            return;
        }
        activity.receiveServerVipPower(serverId, reqMsg);
    }

    @Override
    public void sendData() {

    }
}
